<template>
  <view>
    <view class="withdrawBox">
      <view class="ismouyne">可提现余额 (元)</view>
      <view class="isNumber">￥ {{ mer_money }}</view>
      <view class="bottomBox">
        <view class="mouyneBox">提现余额</view>
        <view class="mouyneflex">
          <view class="mouyneflexBox">
            <view style="padding-right: 50rpx">￥</view>
            <input v-model="min" style="font-size: 50rpx"  type="digit"
          /></view>
          <view class="mouyneflexAll" @click="allMoney">全部提现</view>
        </view>
      </view>
    </view>
    <view class="content">
      <view>提现至</view>
      <view class="zipyal">
        <view class="zifuImage">
          <image src="../../../static/images/Alipay.png"></image>
        </view>
        <view> 支付宝</view>
      </view>
    </view>
    <view class="bannder" @click="submit">申请提现</view>
  </view>
</template>

<script>
import {
  withdrawalApi,
  getmerchantApi,
  getmerchantAccountApi,
  updateAccountApi,
} from "@/api/product";
export default {
  data() {
    return {
      mer_money: 0,
      min: "",
    };
  },
  onLoad(options) {
    this.merId = options.mer_id;
    this.getmerchant();
  },
  methods: {
    allMoney() {
      this.min = this.mer_money;
    },
    getmerchant() {
      getmerchantApi(this.merId).then((res) => {
        this.mer_money = res.data.mer_money;
        console.log(this.mer_money);
      });
    },
    submit() {
      const params = {
        price: this.min,
      };
      withdrawalApi(params, this.merId).then((res) => {
        this.withdrawalDIalog = false;
        this.getmerchant();
        this.$util.Tips({
          title: "提交成功",
        });
        this.min = "";
      });
    },
  },
};
</script>

<style scoped  lang="scss">
.withdrawBox {
  position: relative;
  background: #fc9c56;
  padding-bottom: 90rpx;
}
.ismouyne {
  padding-top: 150rpx;
  padding-left: 30rpx;
  color: #fff;
  font-weight: bold;
  font-size: 35rpx;
}
.isNumber {
  padding-top: 50rpx;
  padding-left: 30rpx;
  font-weight: bold;
  color: #fff;
  font-size: 50rpx;
}
.bottomBox {
  width: 95%;
  border-radius: 20rpx;
  position: absolute;
  padding: 20rpx 20rpx 40rpx 20rpx;
  margin: 20rpx;
  background: #fff;
}
.mouyneBox {
  font-weight: bold;
  font-size: 35rpx;
}
.mouyneflex {
  display: flex;
  justify-content: space-between;
  border-bottom: 1rpx solid #333;
}
.mouyneflexBox {
  display: flex;
  margin: 50rpx 0;
  height: 50rpx;
  line-height: 80rpx;
  font-weight: bold;
  font-size: 40rpx;
}
.mouyneflexAll {
  width: 200rpx;
  margin-right: 20rpx;
  height: 50rpx;
  line-height: 80rpx;
  margin: 50rpx 0;
  font-weight: bold;
  font-size: 30rpx;
  color: rgb(15, 197, 2);
}
.content {
  padding: 0 60rpx;
  font-size: 30rpx;
  font-weight: bold;
  margin-top: 220rpx;
  color: #9e9e9e;
  display: flex;
  justify-content: space-between;
}
.zipyal {
  display: flex;
}
.zifuImage {
  margin-right: 20rpx;
  width: 40rpx;
  height: 40rpx;
  image {
    width: 100%;
    height: 100%;
  }
}
.bannder {
  margin: 50rpx auto 0 auto;
  height: 100rpx;
  line-height: 100rpx;
  text-align: center;
  width: 80%;
  background: #fff;
  border-radius: 15rpx;
  font-weight: bold;
}

</style>